import Vue from 'vue'
import Layout from './components/layout'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import Login from './pages/login'
import DishesList from './pages/dishesList'
import DishesDetail from './pages/dishesDetail'
import ShoppingCart from './pages/shoppingCart'
import Order from './pages/order'
import RestaurantInfo from './pages/restaurantInfo'
import SettleAccounts from './pages/settleAccounts'
import DinersNum from './pages/dinersNum'
import $ from 'jquery'

Vue.use(VueRouter)
Vue.use(VueResource)
Vue.prototype.kdUrl = {
  url_host:'http://test.timors.top/apiserver/api.php?',
  url_par:'version=1&resource=users&method=login'
}
let router = new VueRouter({
  mode:'history',
  routes: [
    {
      path:'/',
      component:Login
    },
    {
      path:'/dishesList',
      component:DishesList
    },
    {
      path:'/dishesDetail',
      component:DishesDetail
    },
    {
      path:'/shoppingCart',
      component:ShoppingCart
    },
    {
      path:'/order',
      component:Order
    },
    {
      path:'/restaurantInfo',
      component:RestaurantInfo
    },
    {
      path:'/settleAccounts',
      component:SettleAccounts
    },
    {
      path:'/dinersNum',
      component:DinersNum
    }
    // {
    //   path:'/detail',
    //   component:DetailPage,
    //   redirect:'/detail/analysis',  //重定向
    //   children: [
    //     {
    //       path: 'analysis',
    //       component: DetailAnaPage
    //     },
    //     {
    //       path: 'count',
    //       component: DetailCouPage
    //     },
    //     {
    //       path: 'forecast',
    //       component: DetailForPage
    //     },
    //     {
    //       path: 'publish',
    //       component: DetailPubPage
    //     },
    //   ]
    //
    // }
  ]
})



new Vue({
  el: '#app',
  router,
  template: '<Layout/>',
  components: { Layout }
})
